﻿<%@ Page Title="" Language="C#" MasterPageFile="~/cadastros/Site.Master" AutoEventWireup="true" CodeBehind="Pais.aspx.cs" Inherits="CongregacaoOs.WebForm.Cadastros.Pais" %>

<%@ Register Src="~/Cadastros/MessageWindow.ascx" TagPrefix="uc1" TagName="MessageWindow" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

    <script type="text/javascript">


        $(document).ready(function () {
            var activeIndex = parseInt($('#<%=hfIndexAccordion.ClientID %>').val());



            $("#accordion").accordion({
                collapsible: true,
                autoHeight: false,
                navigation: true,
                active: activeIndex,
                change: function (event, ui) {
                    var index = $(this).children('h3').index(ui.newHeader);
                    $('#<%=hfIndexAccordion.ClientID %>').val(index);
                }
            });
        });


    </script>

    <style type="text/css">
        .auto-style3 {
            width: 40px;
        }
    </style>

    <link href="../Content/NewTheme/gridView.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:HiddenField ID="hfIndexAccordion" runat="server" />

    <div id="accordion">
        <h3><a href="#">Consultar</a></h3>
        <div>
            <asp:Panel ID="PainelConsulta" runat="server" Style="width: 70%; margin: 0 auto;">
                <h2>Cadastro de País</h2>
                <hr />
<br />
                <table style="width: 100%">
                    <tr>
                        <td>Nome:
                            <asp:TextBox ID="txtBuscarNome" Width="100%" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>
                            <br />
                            <hr />
                            <asp:GridView ID="gvPais" runat="server" Style="font-size: smaller;"
                                AutoGenerateColumns="False"
                                GridLines="None"
                                AllowPaging="True"
                                CssClass="mGrid"
                                PagerStyle-CssClass="pgr"
                                AlternatingRowStyle-CssClass="alt" OnPageIndexChanging="gvPais_PageIndexChanging" OnRowCommand="gvPais_RowCommand" OnRowDataBound="gvPais_RowDataBound" PageSize="7">
                                <AlternatingRowStyle CssClass="alt" />
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="~/Images/EditDeleteGrid/Edit.png" CommandName="EDITAR" CommandArgument="<%# Bind('idPais') %>" ToolTip="Editar" runat="server" Width="20px" ID="imgEditar" />
                                            &nbsp;&nbsp;&nbsp;
                                <asp:ImageButton ImageUrl="~/Images/EditDeleteGrid/Delete.png" CommandName="EXCLUIR" runat="server" CommandArgument="<%# Bind('idPais') %>" ToolTip="Excluir" Width="20px" ID="imgDelete" />


                                        </ItemTemplate>
                                        <ItemStyle Width="15%" HorizontalAlign="Center" VerticalAlign="Middle" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="idPais" HeaderText="Código">
                                        <ItemStyle Width="5%" HorizontalAlign="Center" />
                                        <HeaderStyle HorizontalAlign="Center" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="nome" HeaderText="País">
                                        <ItemStyle Width="65%" />
                                        <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                </Columns>
                                <EmptyDataTemplate>
                                    Nenhum registro encontrado...
                                </EmptyDataTemplate>
                                <PagerStyle CssClass="pgr" />
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>                        
                        <td>
                            <div style="float: right;">
                                <asp:Button ID="btnBuscar" runat="server" Text="Pesquisar" OnClick="btnBuscar_Click" />
                                <asp:Button ID="btnAdicionarNovo" runat="server" Text="Adicionar" OnClick="btnAdicionarNovo_Click" />
                            </div>
                        </td>
                    </tr>
                </table>
                <br />



            </asp:Panel>
        </div>
        <h3><a href="#">Cadastrar/Editar</a></h3>
        <div>
            <asp:Panel ID="painelCadastro" runat="server" Style="width: 70%; margin: 0 auto;">
                <asp:HiddenField ID="hdID" runat="server" />
                <label>Nome:</label>
                <asp:TextBox ID="txtNome" Width="100%" runat="server"></asp:TextBox><br />
                <br />
                <asp:Button ID="btnSalvar" runat="server" Text="Salvar" OnClick="btnSalvar_Click" />
                <asp:Button ID="btnVoltar" runat="server" Text="Voltar" OnClick="btnVoltar_Click" />
            </asp:Panel>
        </div>
    </div>


    <uc1:MessageWindow runat="server" ID="MessageWindow" />

</asp:Content>
